package ssm.integration.service.imp;

import ssm.integration.mapper.EmployeeMapper;
import ssm.integration.pojo.Employee;
import ssm.integration.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * description: 业务实现类
 * 测试MyBatis集成效果-07
 *
 * 1. @Service 将业务层实现类注入IOC容器
 * 2. @Autowired 匹配Mapper接口，Mapper接口由持久层配置类 MapperJavaConfigNew 注册到IOC容器
 */

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<Employee> findAll() {
        List<Employee> employees = employeeMapper.queryList();
        return employees;
    }
}
